package com.web.exiaodao.business.repository;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.web.exiaodao.business.entity.SysArea;


public interface SysAreaRepository extends
		PagingAndSortingRepository<SysArea, Long>,
		JpaSpecificationExecutor<SysArea> {
	public SysArea findByIdAndStatusNot(Long id,Integer status);
	public SysArea findByAreaNameAndStatusNot(String areaName,Integer status);

	@Query(value = "SELECT COUNT(*) FROM tb_xa_institution  WHERE sys_area_id = ?1 AND status <> ?2 ", nativeQuery = true)
	public Long findInsCountByAreaIdAndStatusNot(Long categoryId, Integer status);

}
